package com.project.admin.oasign;

import android.app.Application;

import com.tencent.smtt.sdk.QbSdk;
import com.tencent.smtt.sdk.TbsDownloader;

/**
 * @author 文庆
 * @date 2018/5/17.
 * @description
 */

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        initX5WebView();
    }



    private void initX5WebView() {
        try {
            QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
                @Override
                public void onViewInitFinished(boolean onViewInitFinished) {
                    if (!onViewInitFinished) {
                        TbsDownloader.startDownload(getApplicationContext());
                    }
                }
                @Override
                public void onCoreInitFinished() {
                }
            };
            //x5内核初始化接口
            QbSdk.initX5Environment(this, cb);
            QbSdk.setDownloadWithoutWifi(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
